/*************************************************************************
	> File Name: oj-506_queue_for_water.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2020年11月08日 星期日 18时49分54秒
 ************************************************************************/

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

struct stu {
    int id, time;
};

bool cmp(const stu &a, const stu &b) {
    return a.time < b.time;
}

stu stus[35];
int ans[35];

int main() {
    int n, time_all = 0;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> stus[i].time;
        stus[i].id = i;
    }
    sort(stus + 1, stus + n + 1, cmp);
    for (int i = 1; i <= n; ++i) {
        i > 1 && printf(" ");
        printf("%d", stus[i].id);
        ans[i] = ans[i - 1] + stus[i - 1].time;
        time_all += ans[i];
    }
    printf("\n%.2lf", double(time_all) / n);
    return 0;
}
